<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

<h2>User > Edit</h2>
<!-- h5>Editing user '<%= @user.login %>'</h5>	
<hr -->  
  
    <% for name in [:notice, :warning, :message] %>
    <% if flash[name] %>
      <%= "<div class='message-fatal'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>
  
    <% for name in [:simplemsg] %>
    <% if flash[name] %>
      <%= "<div class='message-justmsg'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>


<div>
	<%= start_form_tag ({:action => 'edit_user'},{:class => 'appform'}) %>

		<div class="req"><b>*</b>Required Information </div>

			<fieldset>

				<% if authorized?(:action => "edit_user") %>
  
 					 <%= error_messages_for 'user' %>

				       <!--%=renderEditPanel({"controller"=>"user", "action"=>"edit_user/#{@user.id}"}, 
                	    [{"label"=>"First Name", "name"=>"user[firstname]", "value"=>"#{@user.firstname}", "required"=>"false", "size"=>"30"},
                    	 {"label"=>"Last Name", "name"=>"user[lastname]", "value"=>"#{@user.lastname}", "required"=>"false", "size"=>"30"},
	                     {"label"=>"Login ID", "readonly"=>"true", "value"=>"#{@user.login}"},
    	                 {"label"=>"Email", "readonly"=>"true", "value"=>"#{@user.email}"}],
						    "Edit User Profile", "user", @user ,nil, 
							{"save_string"=>"Change Profile" })% -->
          		
    	    		
    				<h3>Editing user '<%= @user.login %>' Profile</h3>
			      			
					<label for="name"><b>Login ID</b>
						<%= @user.login %>
					</label>

					<label for="name"><b><span class="req">*</span>Email</b>
						<input class="f-name" name="user[email]" value="<%= @user.email %>" style="margin-left: 2px;" size="30" /><br />
					</label>
					
					<label for="name"><b>First Name</b>
						<input class="f-name" name="user[firstname]" value="<%= @user.firstname %>" style="margin-left: 2px;" size="30" /><br />
					</label>

					<label for="name"><b>Last Name</b>
						<input class="f-name" name="user[lastname]" value="<%= @user.lastname %>" style="margin-left: 2px;" size="30" /><br />
					</label>
			
								
					<div class="f-submit-wrap">
            			<!-- input type="submit" name="savebutton" value="Change Profile" /><br / -->
            			<%= image_submit_tag "/themes/odotclassic/images/btn_changeprof.gif",:alt => 'Change Profile', :border => 0 %>
					</div>

				<% end %>
				
			</fieldset>
			
	<%= end_form_tag %>
</div>	



   
<br/>


<div>

	<%= start_form_tag ({:action => 'change_password_for_user', :id => @user.id},{:class => 'appform'}) %>

		<div class="req"><b>*</b>Required Information </div>

			<fieldset>
			
							<!-- <% if authorized?(:action => "change_password_for_user") %>
  							   			<%=renderEditPanel({"controller"=>"user", "action"=>"change_password_for_user/#{@user.id}"}, 
                      					  [{"label"=>"Password", "type"=>"password", "name"=>"user[password]", "value"=>"", "required"=>"false", "size"=>"30"},
				                         {"label"=>"Password Confirmation", "type"=>"password", "name"=>"user[password_confirmation]", "value"=>"", "required"=>"false", "size"=>"30"}],
        								"Edit User Password", "user", @user ,{"back_to"=>"edit"}, 
        									{"save_string"=>"Change Password" })%>
									     <% end %>
							-->
  
				<% if authorized?(:action => "change_password_for_user") %>

				    <h3>Editing user '<%= @user.login %>' Password</h3>

	      			<label for="name"><b><span class="req">*</span>Password</b>
		  				<input class="f-name" type="password" name="user[password]" style="margin-left: 2px;" size="30" /><br />
		  			</label>
			
	     			<label for="name"><b><span class="req">*</span>Password Confirmation</b>
          				<input class="f-name" type="password" name="user[password_confirmation]" style="margin-left: 2px;" size="30" /><br />
	      			</label>
	  
	      			<div class="f-submit-wrap">
	      				<!-- input type="submit" name="savebutton" value="Change Password" /><br / -->
	      				<%= image_submit_tag "/themes/odotclassic/images/btn_changepwd.gif", :alt => 'Change Password', :border => 0 %>
	      			</div>

				<% end %>
				
			</fieldset>
			
	<%= end_form_tag %>
</div>	
  
 
 
<!--
<h2>Roles</h2>
  <% if authorized?(:action => "edit_roles") %>

    <%= start_form_tag :action => 'edit_roles', :id => @user %>
      <%= render_partial 'roles', :submit => true, :user => @user %>
    <%= end_form_tag %>

  <% else %>
  <ul id="user_role_list">
    <% @user.roles.each do |role| %>
    <li><%= role.name %> - <%= role.description %></li><% end %>
  </ul>
  <% end %>

-->


<h2>Roles</h2>
  <% if authorized?(:action => "edit_roles") %>
	    <%= start_form_tag ({:action => 'edit_roles', :id => @user},{:class=> 'appform'}) %>
    		<fieldset>
   			      <%= render_partial 'roles', :submit => true, :user => @user %>
   			</fieldset>
    	<%= end_form_tag %>
  <% else %>
  		<ul id="user_role_list">
    	<% @user.roles.each do |role| %>
    	<li><%= role.name %> - <%= role.description %></li><% end %>
  		</ul>
  <% end %>


   <br/>



    <div class="list">
    	<table>
    	     <th>Actions</th>
             <tr class="even">
                <td>
                  <!-- %= link_if_authorized submit_tag('Show User'), {:action => 'show', :id => @user}  % -->
                  <!-- %= link_if_authorized submit_tag('List Users'), {:action => 'list'}  % -->
                  <%= link_if_authorized image_tag('/themes/odotclassic/images/btn_showuser.png', :alt=>'Show'), {:action => 'show', :id => @user}  %>
                  <%= link_if_authorized image_tag('/themes/odotclassic/images/btn_listusers.png', :alt=>'List'), {:action => 'list'}  %>
                </td>
             </tr>        
    	</table>
    
    </div>

 </div> 
  
 
  
